<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 1. var arr = ["a", 1, "c", "dd", 100, true, 200, "f", 0, false]   去除数组中所有非数字

        function offNoNumber(arr) {
            let res = []
            for (let i = 0; i < arr.length; i++) {
                if (isNaN(arr[i])) {

                } else if (typeof (arr[i]) === "number") {
                    res.push(arr[i])
                }
            }
            return res
        }

        let arr = ["a", 1, "c", "dd", 100, true, 200, "f", 0, false, NaN]


        console.log(offNoNumber(arr));

    </script>
</body>

</html>